package com.zhaohang.cn.utils;

import android.os.Handler;
import android.os.Looper;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * 作者: 赵航
 * 创建时间: 2018/10/20 16:50
 * 描述:
 */
public class ThreadUtils {

    private static Handler  sHandler  = new Handler(Looper.getMainLooper());
    private static Executor sExecutor = Executors.newSingleThreadExecutor();
    public static void runOnSubThread(Runnable runnable){
        sExecutor.execute(runnable);
    }
    public static void runOnUIThread(Runnable runnable){
        sHandler.post(runnable);
    }
}
